﻿namespace cswork3_2
{
    public class Clock
    {
        public event ClockHandler Tick;
        public event ClockHandler Alarm;
        public void Ticking(int h,int m,int s)
        {
            Console.WriteLine($"Time is {h}:{m}:{s}");
            ClockEventArgs args = new ClockEventArgs()
            {
                Hour = h,
                Minute = m,
                Second = s
            };
            Tick(this, args);
        }

        public void Alarming(int h, int m, int s)
        {
            Console.WriteLine($"{h}:{m}:{s}!!It's time to have lunch!");
            ClockEventArgs args = new ClockEventArgs()
            {
                Hour = h,
                Minute = m,
                Second = s
            };
            Alarm(this, args);
        }

    }
}